package com.qf.aspectj;

import org.apache.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;



@Component
@Aspect
public class MyAspectJ {

    Logger logger =Logger.getLogger(MyAspectJ.class);

    @Pointcut("execution(* com.qf.zsq.service.*..*(..))")
    public void qrd(){}

    @Around("qrd()")
    public Object aroundMsg(ProceedingJoinPoint joinPoint){
        logger.info("======service======");

        Object obj=null;

        try {
            obj = joinPoint.proceed();
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
        logger.info("=======service======");
        return obj;
    }
}
